﻿@model List<LearningMVC.Models.User>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<div>
<table>
    <tr>
        <th>
            FirstName
        </th>
        <th>
            LastName
        </th>
        <th>
            EMail
        </th>
        <th>
            Address
        </th>
        <th>
            PhoneNo
        </th>
        <th>
            Company
        </th>
        <th>
            Designation
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.FirstName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.EMail)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Address)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.PhoneNo)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Company)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Designation)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.UserId }) |
                @Html.ActionLink("Details", "Details", new { id=item.UserId }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.UserId })
            </td>
        </tr>
       
    }

</table>
</div>
<div style="float: left;display: block;margin-top: 20px;">
    <span>**ViewData and ViewBag**</span><br/>
   ViewBag: @ViewBag.FirstName<br/>
   ViewData: @ViewData["FirstName"]<br/>

</div>